package com.smzd.framework.workspace;

import java.util.Map;

import com.smzd.framework.system.domain.User;
import com.smzd.utils.SessionHolder;

public class FrameworkViewConfigure implements IFrameworkViewConfigure {

    @Override
    public String getIndexView(Map<String, Object> model) {
        return "/workspace/index.ftl";
    }

    @Override
    public String getSelectMeetingsView(Map<String, Object> model) {
        return "/workspace/meetings.ftl";
    }

    @Override
    public String getWorkspaceView(Map<String, Object> model) {
        return "/workspace/workspace.ftl";
    }

    @Override
    public String getAuthFailedView(Map<String, Object> model) {
        return "/workspace/authfailed.ftl";
    }

    @Override
    public String getLoginView(Map<String, Object> model) {
        User user = SessionHolder.getObject("_remote_user_");
        model.put("_remote_user_", user);
        if (user != null) {// 这是要绑定用户了
            return "/workspace/binduser.ftl";
        }
        return "/workspace/login.ftl";
    }

    @Override
    public String getNoMeetingView(Map<String, Object> model) {
        return "/workspace/nomeeting.ftl";
    }

    @Override
    public String getBindUserLoginPage() {
        return "/workspace/login";
    }

    @Override
    public String getBindUserSuccessView() {
        return "/workspace";
    }

    @Override
    public String getOAuthLoginView(Map<String, Object> model) {
        return "/workspace/oauthlogin.ftl";
    }

    @Override
    public String getAccessDeniedView(Map<String, Object> model) {
        return "/workspace/accessdenied.ftl";
    }

    @Override
    public String getRegisterPage(Map<String, Object> model) {
        return "/workspace/register.ftl";
    }

    @Override
    public String getSuccessPage(Map<String, Object> model) {
        return "/workspace/success.ftl";
    }

}
